<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    {% load static from static %}
    <link rel="stylesheet" href="{% static 'web/css/common.css' %}">
    <link rel="stylesheet" href="{% static 'web/css/bootstrap.css' %}">
</head>
<body>
<div class="container">
    <h1 class="form-heading">login Form</h1>
    <div class="login-form">
        <div class="main-div">
            <div class="panel">
                <h2 style="font-size:26px;">点 餐 系 统 登 录 页 面</h2>
            </div>
            <form action="{% url 'web_dologin' %}" method="post">
                {% csrf_token %}
                <div class="form-group">
                    <select name="shop_id" class="form-control">
                        <option value="0"> - - 请选择商铺名称 - -</option>
                        {% for shop in shoplist %}
                        <option value="{{shop.id}}">{{shop.name}}</option>
                        {% endfor%}
                    </select>
                </div>
                <div class="form-group">
                    <input type="text" name="username" class="form-control" placeholder="登录账号" required>
                </div>
                <div class="form-group">
                    <input type="password" name="pass" class="form-control" placeholder="登录密码" required>
                </div>
                <div class="form-group">
                    <input type="text" name="code" style="display:inline;width:120px;float:left;" class="form-control"
                           placeholder="验证码" required>
                    <img src="{% url 'web_verify'%}" onclick="this.src='{% url 'web_verify' %}?sn='+Math.random()"
                         style="float:right;margin:5px 20px;width:120px;"/>
                </div>

                <button type="submit" style="margin-top:10px" class="btn btn-primary">登录</button>

                <div class="form-group">
                    <p class="login-box-msg" style="color:red">
                        {% if request.GET.info == '1' %}
                            请选择店铺
                        {% elif request.GET.info == '2' %}
                            验证码错误
                        {% elif request.GET.info == '3' %}
                            账号或密码错误
                        {% endif %}
                    </p>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="{% static 'web/js/jquery.min.js' %}"></script>
<script src="{% static 'web/js/bootstrap.min.js' %}"></script>
</body>
</html>